home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / PS2EPSI < prev    next >
Text File  |  1993-05-07  |  859b  |  53 lines

  1. #!/bin/sh
  2.  
  3. LOCALPATH=/usr/local/bin
  4. PATH=/bin:/usr/bin:/usr/ucb\:$LOCALPATH\
  5.  
  6. export PATH outfile
  7.  
  8. if [ $# -lt 1 -o $# -gt 2 ]; then
  9.     echo "Usage: pstoepsi file.ps [file.epsi]" 1>&2
  10.     exit 1
  11. fi
  12.  
  13. infile=$1
  14.  
  15. if [ $# -eq 1 ]
  16. then
  17.     case "${infile}" in
  18.       *.ps)        base=`basename ${infile} .ps` ;;
  19.       *.cps)    base=`basename ${infile} .cps` ;;
  20.       *.eps)    base=`basename ${infile} .eps` ;;
  21.       *.epsf)    base=`basename ${infile} .epsf` ;;
  22.       *)        base=`basename ${infile}` ;;
  23.     esac
  24.     outfile=${base}.epsi
  25. else
  26.     outfile=$2
  27. fi
  28.  
  29. gs -q -dNOPAUSE -dNODISPLAY ps2epsi.ps < ${infile} 1>&2
  30.  
  31. (
  32. cat << BEGINEPS
  33. /InitDictCount countdictstack def
  34. gsave
  35. save
  36. mark
  37. newpath
  38. /showpage {} def
  39. BEGINEPS
  40.  
  41. cat ${infile}
  42.  
  43. cat << ENDEPS
  44. countdictstack InitDictCount sub { end } repeat
  45. cleartomark
  46. restore
  47. grestore
  48. ENDEPS
  49.  
  50. ) >> ${outfile}
  51.  
  52. exit 0
  53.